package com.example.rabbitmqprovider.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: guoc
 * @createDate: 2020/6/10 14:41
 */
@Configuration
public class WorkRabbitConfig {

    @Bean
    public Queue workQueue(){
        return new Queue("workQueue");
    }

    @Bean
    public DirectExchange workExchange(){
        return new DirectExchange("workExchange");
    }

    @Bean
    Binding workBinding(){
        return BindingBuilder.bind(workQueue()).to(workExchange()).with("workQueue");
    }

}
